// 获取设备信息hooks
export const useSystemInfo = () => {
	const SYSTEM_INFO = uni.getSystemInfoSync();

	// 状态栏高度
	const statusBarHeight = ref(SYSTEM_INFO.statusBarHeight || 15)

	// 胶囊按钮高度
	let titleBarHeight = ref(40)
	if (uni.getMenuButtonBoundingClientRect) {
		const MENU_BUTTON = uni.getMenuButtonBoundingClientRect()
		titleBarHeight = ref(MENU_BUTTON.height + (MENU_BUTTON.top - statusBarHeight.value) * 2)
	} else {
		titleBarHeight = ref(40)
	}

	// 计算整体高度
	const navBarHeight = ref(statusBarHeight.value + titleBarHeight.value)

	return {
		statusBarHeight,
		titleBarHeight,
		navBarHeight
	}
}